Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

268
Vistas
What does "mount" mean in express?

I'm learning Express.js and I came across this definition:

"An Express router provides a subset of Express methods. To create an instance of one, we invoke the .Router() method on the top-level Express import. To use a router, we mount it at a certain path using app.use() and pass in the router as the second argument."

What does "mount" mean?

Thank you in advance!

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

Mount simply means it prepends the path to your routes.

Say for example your routes have the following endpoints:

/list
/create
/update
/get/:id

And you mount it to /api/tasks. The endpoints will be:

/api/tasks/list
/api/tasks/create
/api/tasks/update
/api/tasks/get/:id

The way it's done in Express is:

const routes = require('./my/routes');

app.use('/api/tasks',routes);

Note: This terminology comes from how disks/drives work on Unix (Linux, MacOS etc.). Unlike Windows where disks are mounted to letters like C: or D: on Unix disks are mounted to folders. So for example if you connect a thumb drive named "Stuff" on Linux you will find a new folder called:

   /media/your_username/Stuff

And this folder will contain all the data of the thumbdrive. This is done by the automounter but you can also manually mount drives to empty folders. For example if I install the right software on my machine I can mount a remote shared drive to /Users/my_username/projects/shared_drives/shared_pictures.

So it's natural for programmers to call the act of adding things to paths mounting.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda